# coding:utf-8
# 房间逻辑



class Room:
    
	def __init__ (self, room_id, name, mode, max_player):
		self.id = room_id
		self.name = name
		self.mode = mode
		self.max_player = max_player
		
		# 密码
		self.password = ""
		# 玩家列表
		self.players = []


	def __repr__ (self):
		return "<Player:: id:%d name:%s mode:%d max_player:%d>" % \
			(self.id, self.name, self.mode, self.max_player)

	
	# 设置密码
	def set_password (self, pw):
		self.password = pw


	# 加入玩家
	def add_player (self, player):		
		print "玩家进入房间"
		self.players.append(player)


	# 移除玩家
	def remove_player (self, player):
		print "玩家离开房间"		
		self.players.remove(player)

